package com.br.natusport.controller;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

import com.br.natusport.R;
import com.br.natusport.util.ConnectionUtil;
import com.br.natusport.util.PermissionUtil;

public class Inicial extends Activity {
	
	ImageView logo;
	Button btnLogar;
	Button btnConsultar;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_inicial);
		
		logo = (ImageView) findViewById(R.id.imgInicial);
		logo.setOnClickListener(OnClickLogin);
		
		btnLogar = (Button) findViewById(R.id.btnLogar);
		btnLogar.setOnClickListener(OnClickLogin);
		
		btnConsultar = (Button) findViewById(R.id.btnConsultar);
		btnConsultar.setOnClickListener(OnClickConsultar);

	}
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.inicial, menu);
		return true;
	}
	
	private Button.OnClickListener OnClickLogin = new Button.OnClickListener() {
		@Override
		public void onClick(View v) {
			
			PermissionUtil.isConnected = true;
			
			Intent i = new Intent(getBaseContext(), Principal.class);
			startActivity(i);
			overridePendingTransition(R.anim.anim_inicial,R.anim.anim_inicial2);
		}
	};
	
	private Button.OnClickListener OnClickConsultar = new Button.OnClickListener() {
		@Override
		public void onClick(View v) {
			
			PermissionUtil.isConnected = false;
			
			Intent i = new Intent(getBaseContext(), Agendamento.class);
			startActivity(i);
			overridePendingTransition(R.anim.anim_inicial,R.anim.anim_inicial2);
		}
	};
	

}
